import request from '@/utils/request'

// 封装一个函数获取企业的部门列表
export function getDepartments() {
  return request.get('/company/department')
}

// 封装一个新增企业部门函数
export function addDepartments(data) {
  return request.post('/company/department', data)
}

// 封装一个获取员工简单数据列表
export function getEmployeeSimple() {
  return request.get('/sys/user/simple')
}

// 封装一个根据id删除该对象
export function delDepartment(id) {
  return request.delete(`/company/department/${id}`)
}

// 根据id获取部门详情
export function getDepartDetail(id) {
  return request.get(`/company/department/${id}`)
}

// 根据id修改部门详情
export function updateDepartments(data) {
  return request.put(`/company/department/${data.id}`, data)
}
